package org.jeecg.modules.sggg.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.sggg.entity.SgBlutdruckRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.sggg.entity.SgMember;
import org.jeecg.modules.sggg.entity.SgRemindRecord;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Description: 血压记录表
 * @Author: jeecg-boot
 * @Date: 2022-10-17
 * @Version: V1.0
 */
public interface ISgBlutdruckRecordService extends IService<SgBlutdruckRecord> {

    IPage<SgBlutdruckRecord> queryList (Page<SgBlutdruckRecord> page, String OrgCode,
                                        SgBlutdruckRecord sgBlutdruckRecord,String roleCode, String userId);

    IPage<SgMember> queryPageListBySql(Page<SgMember> page, String sysOrgCode,List<String> responsibleAgencies, Integer day, String roleCode, String userId,String name, String phone,boolean Bindstatus,int deviceType);

    SgBlutdruckRecord getAverageRecord (String memberId, Integer level);

    int getBlutdruckStatistics (String memberId, Integer level);

    SgBlutdruckRecord getBlutdruckStatisticsByDate (String memberId, String dateStartTime, String dateEndTime);

    /*大屏--高危干预预警*/
    List<Map<String, Object>> interventionWarning (String orgCode);

    /*大屏--三高管理人数*/
    List<Map<String, Object>> threeHighNumber (String orgCode);

    IPage<SgBlutdruckRecord> queryListByDoctor (Page<SgBlutdruckRecord> page,String name,String phone,String sysOrgCode,List<String> responsibleAgencies,String roleCode,String doctorId,String intervene);

    /*今日血压预警人数*/
    List<SgBlutdruckRecord> dayMeasureNumberCount (String sysOrgCode,String roleCode,String date,String doctorId,String intervene,List<String> responsibleAgencies);

    /*今日血压测量人数*/
    List<SgBlutdruckRecord> dayMeasureNumberCountTwo (String sysOrgCode,String roleCode,String date,String doctorId,String intervene,List<String> responsibleAgencies);

    List<SgBlutdruckRecord> queryaddressCount();

    /*查询本年度三高总人数*/
    Integer getYearSgCount(Integer yearDate);

    /*查询本年度未超出血压预警总人数*/
    Integer getMonthSgCount(Integer yearDate);

    /*查询每月度三高总人数*/
    List<SgBlutdruckRecord> getMonthControlRate(Integer yearDate);

    /*查询本月度未超出血压预警总人数*/
    List<SgBlutdruckRecord> getXyMonthControlRate(Integer yearDate);

    List<Map<String, Integer>> getEachLevelNum(String orgCode);
}
